<?php
class PageController extends Zend_Controller_Action {
    protected $_service;
    
    public function init()
    {
    	$this->_service = new Service_Page();
    }
	public function indexAction() 
	{
		
	}
	
    public function saveAction()
    {
        $id = $this->_getParam('id', null);
        $this->_service->loadEntity($id);
        $this->view->form = $this->_service->getForm();
        if($this->_request->isPost()){
            if($this->_service->save($this->_request->getPost(), $id)){
                $this->_redirect($_SERVER['HTTP_REFERER']);
            }
        }
    }
	
	public function deleteAction()
	{
		
	}
}